package dao

import "gorm.io/gorm"

type Role struct{}

func (r *Role) GetRoleList(is_broker int, db *gorm.DB) func(db *gorm.DB) *gorm.DB {
	return func(db *gorm.DB) *gorm.DB {
		if is_broker == 1 {
			return db.Where("is_broker = ?", 1)
		} else if is_broker == 2 {
			return db.Where("is_broker = ?", 0)
		} else {
			return db
		}
	}
}

var RoleDao = new(Role)
